<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>学生信息查询系统</title>
    <link href="/static/bootstrap.min.css" rel="stylesheet">
</head>

<body class="bg-light">
  <div class="container mt-5">
    <h1 class="text-center mb-4">🎓 学生信息查询系统</h1>

    <!-- 查询区域 -->
    <div class="card mb-4">
      <div class="card-header">🔍 查询学生信息</div>
      <div class="card-body">
        <div class="mb-3">
          <input type="text" id="studentId" class="form-control" placeholder="请输入学号">
        </div>
        <button onclick="queryStudent()" class="btn btn-primary">查询</button>
        <div id="result" class="mt-3"></div>
      </div>
    </div>

    <!-- 添加学生 -->
    <div class="card">
      <div class="card-header">➕ 添加学生信息</div>
      <div class="card-body">
        <div class="row g-3 mb-3">
          <div class="col">
            <input type="text" id="newId" class="form-control" placeholder="学号">
          </div>
          <div class="col">
            <input type="text" id="newName" class="form-control" placeholder="姓名">
          </div>
        </div>
        <div class="row g-3 mb-3">
          <div class="col">
            <input type="text" id="newGender" class="form-control" placeholder="性别">
          </div>
          <div class="col">
            <input type="number" id="newScore" class="form-control" placeholder="成绩">
          </div>
        </div>
        <button onclick="addStudent()" class="btn btn-success">添加学生</button>
        <div id="addResult" class="mt-3"></div>
      </div>
    </div>


    <!-- 显示全部学生 -->
    <div class="card mt-4">
      <div class="card-header">📋 所有学生列表</div>
      <div class="card-body">
        <button class="btn btn-secondary mb-3" onclick="loadAllStudents()">刷新列表</button>
        <div id="studentTable"></div>
      </div>
    </div>

  </div>

  <script src="/static/app.js"></script>
</body>

</html>
